#include "ResourceLoader.h"
#include <cassert>

ResourceLoader::ResourceLoader(void)
{
}


ResourceLoader::~ResourceLoader(void)
{
}

void ResourceLoader::CreateFile(File** f, const char * fileName)
{
	assert(!(*f) && "Pointer must be NULL.");
	*f = new File(fileName);
	m_FileList.push_back(*f);
}

void ResourceLoader::DestroyFile(File** f)
{
	if(!(*f)) return;
	typedef std::list<File *>::iterator It;
	for(It i = m_FileList.begin(); i != m_FileList.end(); ++i)
	{
		if( *i == *f)
		{
			delete f;
			*f=NULL;
			m_FileList.erase(i);
			break;
		}
	}
	assert(!(*f) && "can't find!");
}

void ResourceLoader::Update()
{
	typedef std::list<File*>::iterator It;
	for(It i=m_FileList.begin(); i!=m_FileList.end(); ++i)
	{
		File * f=*i;
		if(!f->IsReady())
		{
			
		}
	}
}